package app.dev.ems.dto;

import java.io.Serializable;

import app.dev.ems.data.element.FieldType;

public class AvailableComponent implements Serializable {

	private static final long serialVersionUID = -1775229025075145290L;

	private String componentName;
	private int availability;
	private FieldType type;
	
	public AvailableComponent() {

	}
	
	public AvailableComponent(String componentName, int availability, FieldType type) {
		this.componentName = componentName;
		this.availability = availability;
		this.type = type;
	}

	public String getComponentName() {
		return componentName;
	}

	public void setComponentName(String componentName) {
		this.componentName = componentName;
	}

	public int getAvailability() {
		return availability;
	}

	public void setAvailability(int availability) {
		this.availability = availability;
	}	
	
	public FieldType getType() {
		return type;
	}

	public void setType(FieldType type) {
		this.type = type;
	}

	public void increaseAvailability() {
		availability++;
	}
	
	@Override
	public String toString() {		
		return type.equals(FieldType.NONE) ? componentName : componentName + " (" + availability + " Available)";
	}
}
